﻿<?xml version="1.0" encoding="utf-8" ?>
<AdoNetDataAccess connection="$ArticleDBConnection$"  formatter="bizobj of CompanyLimits">
	<Sql>
		SELECT COUNT(Articles.id) AS currentArticleCount,@id as id
		FROM Articles INNER JOIN
		ArticleSet ON Articles.setId = ArticleSet.id INNER JOIN
		ArticleGroup ON ArticleSet.groupId = ArticleGroup.id INNER JOIN
		ObjectTreeNodes ON ArticleGroup.companyId = ObjectTreeNodes.id
		WHERE ObjectTreeNodes.parentHostId = @id
	</Sql>
	<Param name="id" type="UniqueIdentifier" />
</AdoNetDataAccess>